Skip to main content

revXMLNodeContents

Type

function

Summary

Returns the text contained in the specified node in an XML tree.

Syntax

revXMLNodeContents(<treeID>, <node>)

Description

Use the revXMLNodeContents function to get the text contents of a node.

If the revXMLNodeContents function encounters an error, it returns an error message starting with "xmlerr".

The revXMLNodeContents function returns the text content of a node. This is defined as the first piece of text not contained within a child node. For example:

<root>Text<child>Child Text</child>Text 2</root>

In the preceeding XML document, revXMLNodeContents will return the string "Text" when called with "root" as the node.

Important

The revXMLNodeContents function is part of the XML library. To ensure that the function works in a standalone application, you must include this custom library when you create your standalone. In the Inclusions pane of the Standalone Application Settings window, make sure the "XML" checkbox is checked.

Parameters

NameTypeDescription

treeID

The number returned by the revXMLCreateTree or revXMLCreateTreeFromFile function when you created the XML tree.

node

The path to the node whose contents you want to get.

Examples

revXMLNodeContents(3,"/Book/Chapter/Section")
put revXMLNodeContents(thisDoc,mySection) into field "Current Section"

command: revXMLDeleteNode, revXMLAppend

control structure: function

function: revXMLAttribute, revXMLCreateTree, revXMLCreateTreeFromFile

glossary: node, Standalone Application Settings, standalone application, XML tree, return, LiveCode custom library

keyword: string

library: XML library

Compatibility and Support

Introduced

LiveCode 2.0

OS

mac

windows

linux

ios

android

Platforms

desktop

server

mobile

Thank you for your feedback!

Was this page helpful?